1. /* sloshftl.cpp by K.Tsuru */
  2. // function ID = 244 DARDIX
  3. /***********************
  4. SLong class
  5. bit shift operator m<<n
  6. It mutiplis by 2^n.
  7. ***********************/
  8. #ifndef SN_H
  9. #include "sn.h"
  10. #endif
  11. SLong operator<<(const SLong& m, ulong n){
  12. if(!n || (m.Sign(244) == 0)) return m;
  13. double x = (n < 100L) ? pow(2.0, (int)n) : DBL_MAX; // ver.2.17
  14. if(x < (double)m.SlOpMaxValue()){
  15. ulong d = 1L << (int)n;
  16. return LsMult(m, d);
  17. }
  18. SLong two(m.Type(), m.MinSize(), 2L);
  19. SLong result = Lpow(two, n); // 2^n
  20. result *= m;
  21. return result;
  22. }

sloshftl.cpp : last modifiled at 2015/11/27 14:26:29(573 bytes)
created at 2017/10/07 10:26:50
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).